﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected string tip = string.Empty;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["logoff"] + "" == "y")
        {
            LogicLayer mgr = new LogicLayer();
            mgr.Logoff(this.Context);
            Response.Redirect("/");
        }

        if (IsPostBack)
        {
            LogicLayer mgr = new LogicLayer();
            int r = mgr.Logon(Request.Form["UserName"], Request.Form["UserPwd"],this.Context);
            if (r == 0)
                Response.Redirect("portal/");
            else
                tip = "登录失败!";
        }
    }
}